from django.contrib import admin

# Register your models here.

from .models import User


# 配置数据的展示
class UserAdmin(admin.ModelAdmin):
    # 设置显示哪些字段
    list_display = ['username', 'password', 'age', 'sex']
    # 添加搜索字段
    search_fields = ['username']
    # 分⻚
    list_per_page = 5
    # 过滤字段‘
    list_filter = ['username']


# 注册模型类 在后台展示
admin.site.register(User, UserAdmin)
